<template>
  <div class="about">
    <el-container>
      <el-header>
        <div class="header">
          <div>学生宿舍管理系统</div>
          <div>
            <el-dropdown>
              <span class="el-dropdown-link">
                {{ user.name }}
                <i class="el-icon-arrow-down el-icon--right"></i>
              </span>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item @click.native="logout"> 退出登录</el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown>
          </div>
        </div>
      </el-header>
      <el-container>
        <el-aside width="200px">
          <el-menu
            default-active="/index"
            class="el-menu-vertical-demo"
            @open="handleOpen"
            @close="handleClose"
            router
            background-color="#545c64"
            text-color="#fff"
            active-text-color="#ffd04b"
          >
            <el-menu-item index="/index">
              <i class="el-icon-menu"></i>
              <span slot="title">学生管理</span>
            </el-menu-item>
            <el-menu-item index="/index1">
              <i class="el-icon-document"></i>
              <span slot="title">宿管管理</span>
            </el-menu-item>
            <el-menu-item index="/index2">
              <i class="el-icon-document"></i>
              <span slot="title">楼宇管理</span>
            </el-menu-item>
            <el-menu-item index="/index3">
              <i class="el-icon-document"></i>
              <span slot="title">宿舍管理</span>
            </el-menu-item>
            <el-menu-item index="/index4">
              <i class="el-icon-document"></i>
              <span slot="title">入住管理</span>
            </el-menu-item>
            <el-menu-item index="/index5">
              <i class="el-icon-document"></i>
              <span slot="title">管理员管理</span>
            </el-menu-item>
          </el-menu>
        </el-aside>
        <el-main><router-view></router-view></el-main>
      </el-container>
    </el-container>
  </div>
</template>
<script>
export default {
  data() {
    return {
      user: {},
    };
  },
  mounted() {
    this.user = JSON.parse(window.localStorage.getItem("user"));

    this.getdata();
  },
  methods: {
    handleClose() {},
    handleOpen() {},
    getdata() {},
    logout(){
      this.$router.push("/")
    },
  },
};
</script>
<style>
.el-container {
  height: 100%;
}
.el-menu {
  height: 100%;
}
.el-header {
  padding: 0px !important;
}
</style>
<style scoped>
.about {
  width: 100%;
  height: 100%;
}
.header div:first-child {
  font-size: 18px;
}
.header {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgb(101, 47, 155);
  color: #fff;
}
</style>
